<%@page import="user.Uers"%>
<%@page import="user.Item"%>
<%@page import="java.net.URLDecoder"%>
<%@page import="java.net.URLEncoder"%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/"; 
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'user.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>

<body>
	<%--
		String username = "";
		String password = "";
		Cookie[] cookie = request.getCookies();
		if (cookie.length > 0 && cookie != null) {
			for(Cookie c :cookie){
				if(c.getName().equals("username")){
					username =URLDecoder.decode(c.getValue(),"utf-8");
				}
				if(c.getName().equals("password")){
					password =URLDecoder.decode(c.getValue(),"utf-8");
				}
			}
		}
	--%>
	<h1>所有用户信息</h1>
	<hr>
	<%
		Item item = new Item();
		ArrayList<Uers> arr = item.getUers();
		Uers user;

		if (arr != null && arr.size() > 0) {
			for (int i = 0; i < arr.size(); i++) {

				user = arr.get(i);
				String username = user.getUsername();
				String password = user.getPassword();
				String adress = user.getAddress();
	%>
	<p>
		用户名：<%=username%><br>
	</p>
	<p>
		密码：<%=password%></p><p>
		地址：<%=adress%><br>
	</p><br><br><br>
	<%
		}
		}
	%>
</body>
</html>
